package wfm.entities;

import java.io.Serializable;
import java.util.List;

import com.web.util.Workers;

public class Partner implements Serializable {
	
	private static final long serialVersionUID = -1389123898539041973L;
	
	private String id; 
	private String name;
	private String telNo;
	private Address address;
	private String email;
	private List<Worker> workers;
	
	public Partner(String name, Address address, String tel, String email){
		this.name = name; 
		this.telNo = tel;
		this.address = address; 
		this.email = email;
		
		this.workers = Workers.getWorkersByPartnerName(name);
	}
	
	public Partner(){
		
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getTelNo() {
		return telNo;
	}
	public void setTelNo(String telNo) {
		this.telNo = telNo;
	}
	public Address getAddress() {
		return address;
	}
	public void setAddress(Address address) {
		this.address = address;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}

	public List<Worker> getWorkers() {
		return workers;
	}

	public void setWorkers(List<Worker> workers) {
		this.workers = workers;
	}
	
	public Worker getWorker(){
		if(this.workers != null && this.workers.size() > 0){
			return this.workers.get(0);
		}
		return null;
	}
}
